/*
 * Copyright 2011-2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0.
 * See `LICENSE` in the project root for license information.
 */

package me.ijleex.platform.system.role.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import me.ijleex.platform.system.role.entity.Role;
import me.ijleex.platform.system.role.mapper.RoleMapper;
import me.ijleex.platform.system.role.service.IRoleService;

/**
 * 角色 服务层实现
 *
 * @author liym
 * @since 2019-03-14 11:19:03 By 'codegen'
 */
@Service
public class RoleServiceImpl implements IRoleService {

    private final RoleMapper mapper;

    public RoleServiceImpl(RoleMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public int insertRole(Role role) {
        return this.mapper.insert(role);
    }

    @Override
    public int deleteRoleByIds(String ids) {
        return this.mapper.delete(ids);
    }

    @Override
    public int updateRole(Role role) {
        return this.mapper.update(role);
    }

    @Override
    public List<Role> getRoleList(Role role) {
        return this.mapper.selectList(role);
    }

    @Override
    public Role getRoleById(Long id) {
        return this.mapper.selectById(id);
    }

}
